#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/epoll.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <fcntl.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <time.h>
#include <netdb.h>

#include <iostream>
//#include <map>
//#include <string>
#include <cstring>

#define  EPOLL_MAX_EVENT 10
typedef struct {
	struct epoll_event events[EPOLL_MAX_EVENT + 1];
	int nevents;
	int epfd;
}Epollop;

#define MAX_UDP_PACKAGE_SIZE 1400

typedef enum
{
	eLoginCmd = 101,
	eGetPeerNetAddrCmd = 102,
	eClientToClientCmd = 103,
	ePenetrateCmd = 104,
	eNormalCmd = 105,
}ProtoCmd;


#define CPU_ID_SIZE 12
typedef char MacType[CPU_ID_SIZE + 1];


void sendUdpPackage(const unsigned char *data, const int dataSize, const int sock, const struct sockaddr_in *rNetAddr);

void getLocalMacAddr(char *macAddr);
int getIpFromDomainName(char *ip, const char *domainName);
